1. Field of the Invention
The present invention relates to a focus adjustment technique. More specifically, obtaining an optimum in-focus position when focus adjustment is performed based on an image signal from an image sensor.
2. Description of the Related Art
Conventionally, as an imaging control method for a CMOS image sensor, there is an electronic shutter control method called the rolling shutter. In a shooting operation with the rolling shutter, a plurality of pixels arranged two-dimensionally are sequentially scanned in small units, such as row by row, to read electric charge from the pixels and reset the pixels. After the lapse of a predetermined period of time (charge accumulation time or exposure time) that starts immediately after the reset of the pixels, the pixels are scanned again in the same way as the pixels were reset, so that the electric charge is read from the pixels, and the read charge (image signal) is output. When a moving image is captured, the above operation is performed in one-frame periods.
When shooting a photo with the rolling shutter described above, a time difference occurs between image capturing timing of the first row of pixels and of the last row of pixels. Therefore, in an image of one frame, the scenes having the time difference between the top row and the bottom row coexist.
Meanwhile, a method of an auto focus operation is well known, which moves the focusing lens to a plurality of positions and captures images and determines an in-focus position based on a series of AF evaluation values obtained by an arithmetic operation of an image signal. This method is divided into two types: one type stops the focusing lens after the lens has been moved, and then captures an image, and another type captures images while moving the lens continuously. A problem with the former type is that it takes time because before you take a photo and you have to wait for the lens to stop. Therefore, the latter is advantageous for speed-up of auto focusing.
In the latter type, it is necessary to determine a lens position corresponding to auto focus (AF) evaluation value. As a concrete example, a method is well known which obtains a barycentric position of the center line in an AF area by performing a correction calculation based on a drive time of the optical system, a size of the AF area on the image sensor, and an exposure time (Japanese Patent Application Laid-Open No. 2007-267278, for example).
However, if the latter method is adopted, the image sensor, which shows a difference in timing for charge accumulation in different AF areas, produces a negative effect as follows.
When a contrast difference is large between the upper and lower portions of the image in the AF area, the following problem arises. FIG. 12A illustrates a case where an AF evaluation value and a barycentric position of the AF area in a single AF area are calculated. FIG. 12B illustrates a case where in order to calculate an AF evaluation value and a barycentric position around the area where intrinsically there ought to be a contrast, the inside of the AF area is divided into sections and an AF evaluation value and a barycentric position are calculated for each section.
When AF evaluation values are calculated while moving the lens continuously, as shown in FIG. 12C, as usual, there are differences in the correspondence relation between the AF evaluation values and the barycentric positions obtained in the single AF area, and the AF evaluation values and the barycentric positions calculated in the vicinity of the area where there is a contrast. This is attributable to differences in the position of the lines used for calculation of the barycentric positions and also to the influence of the rolling shutter, which are difficult to avoid, in principle.
In other words, a time lag becomes large between an intrinsic in-focus position and an in-focus position indicated by actual AF evaluation values, depending on the size of the AF area and the contrast of the image in the AF area, a degree of time lag in charge accumulation due to the rolling shutter, or a moving speed of the lens when the lens is moved continuously. This leads to a worsening of the focusing accuracy of auto focus.